/*
 * WageEmployee.java
 *
 * This class is a derived class of Employee class, used to store
 * the salary details of the waged employees and display the same.
 *
 * 
 */

package com.javacore.day6.maxsoft1;

/**
 * WageEmployee class contains all the details of waged employees.
 * @author 
 */
public class WageEmployee extends Employee {
    
    /** Creates a new instance of WageEmployee */
    public WageEmployee() {
    }
    
    /**
     * Creates a new instance of WageEmployee and stores details
     * in the instance variables.
     * @param name Parameter containing the name of the employee
     * @param wageRate Parameter containing the rate for an hour
     * @param wageHours Parameter containing the number of hours worked 
     */
    public WageEmployee(String name, double wageRate, int wageHours) {
        super(name);
        rate = wageRate;
        hours = wageHours;
    }
    
    /**
     * Method to display the details of waged employees.
     */
    void displayDetails() {
        super.displayDetails();
        System.out.printf("\n" + empName + "'s Salary: %.2f\n", rate * hours);
    }
    
    /**
     * Instance variable to store rate for one hour.
     */
    double rate;
    
    /**
     * Instance variable to store the employee's working hours.
     */
    int hours;
    
}
